<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 创建数组
        var numArray = [1,2,3];
        console.log(numArray);

        // 访问每一个
        console.log(numArray[0]);
        console.log(numArray[1]);
        console.log(numArray[2]);

        // 修改数据
        numArray[0] = 100;
        console.log(numArray);


        // 查看数组总数;
        console.log(numArray.length);
        // 访问最后一个成员
        console.log(numArray[numArray.length-1]);

        // 通过length为数组设置成员,数组就被拉长
        numArray[numArray.length] = 100;
        console.log(numArray);
        // 无规律拉长数据
        numArray[10] = 1000;
        // 保存不同数据类型数据
        numArray[numArray.length] = "hello";
    </script>
</body>
</html>